<!--#include file="admin/Includes/constants.asp"-->
<!--#include file="admin/Includes/validate.asp"-->
<%
SSLMode = 1
'------------Authentication----------------------------
Verify
'------------Authentication----------------------------
MakeSSL 1
Dim ArticleID, SubCat, SubCatName, strURL, strAction
Dim aData, hasData
Dim aData2, nRows2, rCount2, hasData2
Dim aData3, nRows3, rCount3, hasData3
Dim aData4, nRows4, rCount4, hasData4
Dim aData5, nRows5, rCount5, hasData5
Dim sTitle, sKeywords, sDescription, sSubTitle, sContentEN
dim txtStyle, ImageW, LayoutFormat, sAvatarO, sAvatarC
dim fYear


ArticleID=request("aid")

strSQL = "{CALL a_user_detail_sel ('"&CookieID&"', "& ArticleID &")}"	
'response.write strsql
exec(strsql)

	If Not RS Is Nothing Then
	If Not RS.EOF Then
		aData = RS.getrows		
		hasData=True			
		fYear = aData(10,0)
	End If
	End If	
	
	'Images Verticle
	Set RS=RS.NextRecordSet	
	If Not RS Is Nothing Then
	If Not RS.EOF Then		
		aData2 = RS.getrows		
		nRows2 = Ubound(aData2,2)
		hasData2=True		
	End If
	End If		
	
	'Images Horizontal
	Set RS=RS.NextRecordSet	
	If Not RS Is Nothing Then
	If Not RS.EOF Then		
		aData3 = RS.getrows		
		nRows3 = Ubound(aData3,2)
		hasData3=True		
	End If
	End If	
	
	'Other Articles
	Set RS=RS.NextRecordSet	
	If Not RS Is Nothing Then
	If Not RS.EOF Then		
		aData4 = RS.getrows		
		nRows4 = Ubound(aData4,2)
		hasData4=True				
	End If		
	End If	
	CloseCon

If hasData Then
sTitle=left(aData(1,0) & " " & aData(0,0),60)
sSubTitle=aData(1,0) & " " & aData(0,0)
If aData(7,0) <> "" Then
	sKeywords=replace(aData(7,0)," ",",")
End If
sDescription=left(aData(1,0) & " " & aData(0,0) & " " & aData(4,0),200)
sContentEN=aData(1,0) & " " & aData(4,0)
SubCat=aData(6,0)
SubCatName=replace(aData(5,0)," ","-")	
MainCatID=aData(8,0)
LayoutFormat=aData(9,0)

InitArticleNaming
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<Meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<% Response.Charset="UTF-8" %>
	<title><%= sTitle %></title>
	<Meta http-equiv=" content-language" content ="vi">
	<Meta name="Robots" content="noindex,nofollow">
	<meta http-equiv="imagetoolbar" content="no">
	<meta http-equiv="imagetoolbar" content="false">
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> 
	<link rel="icon" href="favicon.ico" type="image/x-icon"> 
	<link rel="STYLESHEET" type="text/css" href="system/styles.css">
</head>
<body>
<div id="container">
<div id="bt2"><img src="hinh-thoi-trang/bg_top.gif" width="1049" height="20"></div>
<div id="tp">
<table border="0" cellpadding="0" cellspacing="0" width="990" align="center">	
	<!--top-->
	<!--#include file="system/top.asp" -->
	<!--/top-->
	<tr bgcolor="#6b5a60">
		<td width="160" style="height:1px;"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td>
		<td width="522" valign="top" rowspan="2">		
		<!--body content-->		
			<!--cover-->		
		<table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="#B6A8AD">			
			<tr><td colspan="3" style="padding-left:12px; "><img src="hinh-thoi-trang/<%=SubCatName%>-hp.gif" width="400" height="40"></td></tr>
			<tr>
				<!--col left-->		
				<td valign="top">
					<table cellpadding="0" cellspacing="0" border="0" bgcolor="#B6A8AD"  width="100%">				
					<!--Product Listings-->
					<% 	

					Dim c_ColPerRow, c_StartCel, c_EndCel, c_nFillCels, c_isRowEnd, c_DataTotal, c_Count, c_arrData
					Dim TDstyle, Image, ImgOrientation
					
					If hasData And hasData2 And nRows2 => 0 Then 
					
					'Assign variables
					If LayoutFormat = 2 Then 'avatar layout
						c_ColPerRow = 5
					Else
						c_ColPerRow = 2
					End If
					c_DataTotal = nRows2
					c_Count = rCount2											
					'system-calculations----------------------------------------------
					If (c_DataTotal) Mod c_ColPerRow > 0 Then
						c_EndCel = (Int(((c_DataTotal)/c_ColPerRow))+1)*c_ColPerRow
					Else
						c_EndCel = c_DataTotal
					End If						
					'system-calculations----------------------------------------------			
								
					TDstyle = "align=""right"""
					
					For c_Count = 0 To c_EndCel 
							
						If c_Count = 0 Then	
							If hasData2 and aData(1,0) <> "" Then
									'Image=Replace(aData(1,0)," ","-") & "-d" & ArticleID & "-" & aData2(0,c_Count) & ".jpg"								
									Image = getNameImage (getPrefixName(fyear, aData(1,0)) , ImgDet, ArticleID , aData2(0,c_Count) )																		
								Else 
									Image="de_clear.gif"
								End If						
								strURL="iid=" & aData2(3,c_Count) & "&in="&Image&"&o=v&aid="&ArticleID&"&ckid="&ckid
								
								If SubCat = "35" Then	
									strAction="<a href='download.asp?iid=" & aData2(3,c_Count) & "&is=1024&in=" & Image & "&dt=4' class='DetailAction' >1024x768</a>|<a href='download.asp?iid=" & aData2(3,c_Count) & "&is=800&in=" & Image & "&dt=4' class='DetailAction'>800x600</a>|<a href='emailfriend.asp?dt=4&" & strURL & "' class='DetailAction'>Gửi hình nền</a>"
								ElseIf SubCat = "49" Then 'avatar
									sAvatarO="<a href='download.asp?iid=" & aData2(3,c_Count) & "&in=" & Image & "&dt=5' class='DetailAction' style='margin:2'>"
									sAvatarC="</a>"
									strAction="<a href='download.asp?iid=" & aData2(3,c_Count) & "&in=" & Image & "&dt=5' class='DetailAction' style='margin:2'>Tải avatar</a>"
								Else
									strAction="<img src='hinh-thoi-trang/ico_ecard.gif' width='19' height='18' border='0' align='absmiddle'><a href='ecard.asp?dt=3&" & strURL & "' class='DetailAction' style='margin:0 6 0 0'>Gửi thiệp số</a><img src='hinh-thoi-trang/ico_album.gif' width='19' height='18' border='0' align='absmiddle'><a href='user_favimg_add.asp?fid="&aData2(3,c_Count)&"&dt=3&ckid="&ckid&"' class='DetailAction' style='margin:0px;'>Lưu vào album</a>"
								End If		
								
								If aData2(2,c_Count) <> "" Then
									ImageW=aData2(2,c_Count) 
								Else
									ImageW="250"
								End If
						 %>			
						<tr bgcolor="#F7F6BD">						
							<td valign="top" colspan="2" style="padding:0 15 0 15">			
								<div id="ImageMain">								
									<div style="width:<%= ImageW %>px;"><%=sAvatarO%><img src="hinh-anh-nguoi-mau/<%=Image%>" alt="<%= aData(1,c_Count) %>" Title="<%= aData(1,c_Count)%>"><%=sAvatarC%></div>
									<div style="width:<%= ImageW %>px; text-align:left; background-color:#7C6787;"><%=strAction%></div>
									<div style="width:<%= ImageW %>px;font-size:10px; text-align:left;"><h5 style="margin:5 0 8 0; line-height:130%"><% If aData2(1,c_Count) <> "" Then response.Write(trim(aData2(1,c_Count))) End If %></h5></div>
								</div>
								<h5 style="padding:12 0 0 0"><b class="dtTitle"><%=Trim(aData(0,c_Count))%></b><br><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"><br><%= aData(3,c_Count) %>
								<br><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="10" border="0"><br>
								<div style="color:#7C6787;font-size:10px" align="right"><%= aData(2,c_Count) %></div>
								</h5>			
							</td>
						</tr>					
						<tr><td colspan="2" valign="middle" style="padding:7 3 5 0;" align="right"><div><img src="hinh-thoi-trang/ico_print.gif" alt="In trang này" width"16" height="16" align="absmiddle"><a href="detail_print.asp?aid=<%= ArticleID %>&ckid=<%=ckid%>" target="_blank" class="Command" style="margin:0 0 0 4;">In trang này</a><img src="hinh-thoi-trang/de_clear.gif" width="13" height="1"><img src="hinh-thoi-trang/ico_email.gif" alt="Gởi trang này" width="16" height="16" align="absmiddle"><a href="emailFriend.asp?dt=2&aid=<%= ArticleID %>&ckid=<%=ckid%>" class="Command" style="margin:0 0 0 5;">Gởi trang này</a><img src="hinh-thoi-trang/de_clear.gif" width="5" height="1"></div></td></tr>				
						<tr bgcolor="#000000"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td></tr>
						<tr bgcolor="#B6A8AD"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="7" border="0"></td></tr>
						<!--system header-->
						<tr bgcolor="#B6A8AD" align="center">					
							<td colspan="2">
							<table border="0" cellpadding="0" cellspacing="1">		
								<!--top border line-->	
								<tr>
					<!--/system header-->					
					<% 	Else		
																	
								'system--------------------------------
								If ((c_Count) Mod c_ColPerRow)=0 Then
									c_isRowEnd = True
								End If
								'system--------------------------------	
																					
								'Write data Start
								If c_Count <= c_DataTotal Then 'Real Data	
								
								If hasData2 and aData(1,0) <> "" Then
									'Image=Replace(aData(1,0)," ","-") & "-d" & ArticleID & "-" & aData2(0,c_Count) & ".jpg"								
									Image = getNameImage (getPrefixName(fyear, aData(1,0)) , ImgDet, ArticleID , aData2(0,c_Count) )																											
								Else 
									Image="de_clear.gif"
								End If						
								strURL="iid=" & aData2(3,c_Count) & "&in="&Image&"&o=v&aid="&ArticleID&"&ckid="&ckid
								
								If SubCat = "35" Then	
									strAction="<a href='download.asp?iid=" & aData2(3,c_Count) & "&is=1024&in=" & Image & "&dt=4' class='DetailAction' >1024x768</a>|<a href='download.asp?iid=" & aData2(3,c_Count) & "&is=800&in=" & Image & "&dt=4' class='DetailAction'>800x600</a>|<a href='emailfriend.asp?dt=4&" & strURL & "' class='DetailAction'>Gửi hình nền</a>"
								ElseIf SubCat = "49" Then 'avatar
									sAvatarO="<a href='download.asp?iid=" & aData2(3,c_Count) & "&in=" & Image & "&dt=5' class='DetailAction' style='margin:2'>"
									sAvatarC="</a>"
									strAction="<a href='download.asp?iid=" & aData2(3,c_Count) & "&in=" & Image & "&dt=5' class='DetailAction' style='margin:2'>Tải avatar</a>"
								Else
									strAction="<img src='hinh-thoi-trang/ico_ecard.gif' width='19' height='18' align='absmiddle'><a href='ecard.asp?dt=3&" & strURL & "' class='DetailAction' style='margin:0 6 0 0'>Gửi thiệp số</a><img src='hinh-thoi-trang/ico_album.gif' width='19' height='18' border='0' align='absmiddle'><a href='user_favimg_add.asp?fid="&aData2(3,c_Count)&"&dt=3&ckid="&ckid&"' class='DetailAction' style='margin:0px;'>Lưu vào album</a>"
								End If	
								
								If LayoutFormat = 2 Then 'avatar layout									
										TDstyle =  "align=""center"""
										txtStyle="margin:1px"									
								Else
									If ((c_Count) Mod c_ColPerRow)=0 Then
										TDstyle =  "align=""left"""
										txtStyle="margin-left:3px"
									Else
										TDstyle = "align=""right"""
										txtStyle="margin-right:3px"
									End If
								End If
								
								If aData2(2,c_Count) <> "" Then
									ImageW=aData2(2,c_Count) 
								Else
									ImageW="250"
								End If											
									%>																
									<td valign="top" width="50%" <%= TDstyle %>>
										<div style="width:<%= ImageW %>px; <%=txtStyle%>;"><%=sAvatarO%><img src="hinh-anh-nguoi-mau/<%= Image %>" border="0" alt="<%= aData2(1,c_Count) %>" title="<%= aData2(1,c_Count) %>"><%=sAvatarC%></div>
										<div style="width:<%= ImageW %>px; text-align:left; <%=txtStyle%>; background-color:#7C6787;"><%=strAction%></div>
										<div style="width:<%= ImageW %>px;font-size:10px; text-align:left; <%=txtStyle%>;"><h5 style="margin:5 0 8 0; line-height:130%"><% If aData2(1,c_Count) <> "" Then response.Write(trim(aData2(1,c_Count))) End If %></h5></div>
									</td>								
							<%	Else 'Fill Cells
									response.write "<td " & TDstyle & " width=""50%"">&nbsp;</td>" & vbcrlf	
								End If
								'Write data End							
								'system-------------------------------
								If c_isRowEnd Then							
									response.write "</tr>" & vbcrlf		
									If c_Count < c_EndCel Then
										response.write "<tr>" & vbcrlf	
									End If								
									c_isRowEnd = False
								End If								
								'system-------------------------------										
						End If					
								Next %>							
					<!--system footer-->	
							</tr>
							
						<%
						If hasData3 Then
						 	For rCount3 = 0 To nRows3 
							'Image = Replace(aData(1,0)," ","-") & "-d" & ArticleID & "-" & aData3(0,rCount3) & ".jpg"
							Image = getNameImage (getPrefixName(fyear, aData(1,0)) , ImgDet, ArticleID , aData3(0,rCount3) )
							strURL="iid=" & aData3(3,rCount3)& "&in="&Image&"&o=h&aid="&ArticleID&"&ckid="&ckid
							
							If SubCat = "35" Then	
								strAction="<a href='download.asp?iid=" & aData3(3,rCount3) & "&is=1024&in=" & Image & "&dt=4' class='DetailAction' >1024x768</a>|<a href='download.asp?iid=" & aData3(3,rCount3) & "&is=800&in=" & Image & "&dt=4' class='DetailAction' >800x600</a>|<a href='emailfriend.asp?dt=4&" & strURL & "' class='DetailAction'>Gửi hình nền</a>"
							ElseIf SubCat = "49" Then 'avatar
								sAvatarO="<a href='download.asp?iid=" & aData2(3,rCount3) & "&in=" & Image & "&dt=5' class='DetailAction' style='margin:2'>"
								sAvatarC="</a>"
								strAction="<a href='download.asp?iid=" & aData3(3,rCount3) & "&in=" & Image & "&dt=5' class='DetailAction' style='margin:2'>Tải avatar</a>"							
							Else
								strAction="<img src='hinh-thoi-trang/ico_ecard.gif' width='19' height='18' border='0' align='absmiddle'><a href='ecard.asp?dt=3&" & strURL & "' class='DetailAction' style='margin:0 6 0 0'>Gửi thiệp số</a><img src='hinh-thoi-trang/ico_album.gif' width='19' height='18' border='0' align='absmiddle'><a href='user_favimg_add.asp?fid="&aData3(3,rCount3)&"&dt=3&ckid="&ckid&"' class='DetailAction' style='margin:0px;'>Lưu vào album</a>"
							End If	
							
							If aData3(2,rCount3) <> "" Then
									ImageW=aData3(2,rCount3)
								Else
									ImageW="506"
								End If	
							%>	
							<tr>
								<td colspan="2" align="center">
									<div style="width:<%= ImageW %>px; background-color:#7C6787"><%= sAvatarO %><img src="hinh-anh-nguoi-mau/<%= Image %>" border="0" alt="<%= aData3(1,rCount3) %>" title="<%= aData3(1,rCount3) %>"><%= sAvatarC %></div>
									<div style="width:<%= ImageW %>px; text-align:left;background-color:#7C6787;"><%=strAction%></div>
									<div style="width:<%= ImageW %>px; font-size:10px; text-align:left;"><h5 style="margin:5 0 8 0; line-height:130%"><% If aData3(1,rCount3) <> "" Then response.Write(trim(aData3(1,rCount3))) End If %></h5></div>
								</td>
							</tr>
							<%	Next 
						End If%>
						</table>
						</td>
					</tr>
					<!--/system footer-->	
					<% 	End If		%>
					<tr bgcolor="#000000"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td></tr>
					<tr><td colspan="2" valign="middle" style="padding:7 3 5 0;" align="right"><div><img src="hinh-thoi-trang/ico_print.gif" alt="In trang này" width"16" height="16" align="absmiddle"><a href="detail_print.asp?aid=<%= ArticleID %>&ckid=<%=ckid%>" target="_blank" class="Command" style="margin:0 0 0 4;">In trang này</a><img src="hinh-thoi-trang/de_clear.gif" width="13" height="1"><img src="hinh-thoi-trang/ico_email.gif" alt="Gởi trang này" width="16" height="16" align="absmiddle"><a href="emailFriend.asp?dt=2&aid=<%= ArticleID %>&ckid=<%=ckid%>" class="Command" style="margin:0 0 0 5;">Gởi trang này</a><img src="hinh-thoi-trang/de_clear.gif" width="5" height="1"></div></td></tr>	
						
				<!--/Product Listing-->	
					<% if hasData4 then %>
					<!--Newer Articles-->
					<tr bgcolor="#F7F6BD"><td class="NavL1" style="padding-left:13px;padding-top:10px;color:#6F5C79" colspan="2">Các bài yêu thích khác</td></tr>
					<tr bgcolor="#F7F6BD">						
						<td valign="top" colspan="2">
							<table cellpadding="0" cellspacing="0" border="0">
							<tr><td><img src="hinh-thoi-trang/de_clear.gif" width="1" height="4"></td></tr>
						<%  For rCount4 = 0 to nRows4 %>
							<tr><td class="lsTitle" style="padding-left:15px;"><img src="hinh-thoi-trang/de_arrowr2.gif" width="13" height="16"></td>
							<td><h6><a href="user_detail.asp?aid=<%=aData4(0,rCount4)%>&ckid=<%=ckid%>" title="<%=aData4(2,rCount4)%>" class="lsTitle"><%=Left(aData4(1,rCount4),80)%></a></h6></td></tr>
							<% Next%>		
							</table>	
						</td>
					</tr>
					<% End If %>
					
					</table>
				</td>
				<!--/col left-->							
			</tr>
		</table>
			<!--/text-->		
		<!--/body content-->
		</td>
		<td width="308" style="width:0px;"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td>
	</tr>
	<!--main body-->
	<tr bgcolor="#ffffff">
		<td bgcolor="#000000" width="160" valign="top">
		<!--#include file="system/left_user.asp" -->
		</td>
		<!--missing 1 TD because of Rowspan-->		
		<td bgcolor="#614B00" width="308" valign="top">
			<table border="0" cellpadding="0" cellspacing="0" width="308" align="right">
				<tr bgcolor="#000000"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td></tr>
				<form action="listing.asp?ckid=<%=ckid%>" method="post">
				<tr bgcolor="#8D0045">
					<td width="154" valign="top" height="33" ><input type="text" name="search" value="Tìm kiếm" size="22" class="txtSearch"></td>
					<td width="154" valign="top" style="padding-top:7px;padding-left:3px;"><input type="submit" name="go" value="TÌM" class="btnGo"></td>
				</tr>
				</form>
				<tr bgcolor="#000000"><td colspan="2"><img src="hinh-thoi-trang/de_clear.gif" alt="" width="1" height="1" border="0"></td></tr>
				<!--Ads Starts-->
				<tr><td align="center" colspan="2"><img src="hinh-quang-cao/neimanmarcus350x250.jpg" alt="" width="300" height="250" border="0"></td></tr>
				<!--Ads Ends-->
			</table>
		</td>
	</tr>
	<!--/main body-->
	<!--#include file="system/bottom.asp" -->
</table>
</div>
<div id="bt2"><img src="hinh-thoi-trang/bg_bottom.gif" width="1049" height="20"></div>
</div>
</body>
</html>
<% End If 
DisposeArticleNaming
%>